{% extends "admin/base_site.html" %}
{% load i18n admin_static %}

{% block scripts %}{% endblock %}

{% block extrastyle %}
  {{ block.super }}
  {{ form.media }}
{% endblock %}

{% block main_nav %}{% endblock %}

{% block bodyclass %}{{ block.super }} login{% endblock %}

{% block usertools %}{% endblock %}

{% block nav-global %}{% endblock %}

{% block content_title %}{% endblock %}

{% block breadcrumbs %}{% endblock %}

{% block javascripts %}{% endblock %}

{% block content %}
  {% if form.errors and not form.non_field_errors %}
    <p class="errornote">
      {% if form.errors.items|length == 1 %}{% trans "Please correct the error below." %}{% else %}{% trans "Please correct the errors below." %}{% endif %}
    </p>
  {% endif %}

  {% if form.non_field_errors %}
    {% for error in form.non_field_errors %}
      <p class="errornote">
        {{ error }}
      </p>
    {% endfor %}
  {% endif %}

  <div id="content-main">
    <div class="row">
      <div class="large-3 medium-6 small-12 small-centered columns">
        <div class="row">
          <div class="small-centered columns login-header">
            <h1>Ralph <strong>3</strong></h1>
            <p class="slogan">DCIM &amp; Asset Management System</p>
          </div>
        </div>
        <form action="{{ app_path }}" method="post" id="login-form">{% csrf_token %}
          <fieldset>
            <legend>{% trans 'Please login' %}</legend>
              {{ form.as_p }}
            <button class="login right">{% trans 'Log in' %}</button>
          </fieldset>
          <input type="hidden" name="next" value="{{ next }}" />
          <div class="password-reset-link">
            {% url 'admin_password_reset' as password_reset_url %}
            {% if password_reset_url %}
              <a href="{{ password_reset_url }}">{% trans 'Forgotten your password or username?' %}</a>
            {% endif %}
          </div>
        </form>
      </div>
    </div>
    <script type="text/javascript">
      document.getElementById('id_username').focus()
    </script>
  </div>
{% endblock %}
